var SendMessageHistory = function(){


// 查询条件---begin
	var PactName = new Ext.form.TextField({
		fieldLabel : '合同名称',
	
		width:150
		
	});
	
	var searchName = new Ext.form.TextField({
		fieldLabel : '消息主题',
		width : 150
	});
	
	var searchArea = new Ext.form.TextField( {
		fieldLabel : '客户编号',
		//hiddenName : 'type',
		
		width : 150
	
	});
	
		var companySize = new Ext.form.TextField( {
		fieldLabel : '合同编号',
		//hiddenName : 'type',
	
		width : 150
	
	});
	
	var searchComplateDate = new Ext.form.DateField( {
		fieldLabel : '消息日期',
		format : 'Y-m-d',
		width : 150
	});
		var searchEndDate = new Ext.form.DateField( {
		fieldLabel : '至',
		format : 'Y-m-d',
		width : 150
	});
	
	var btn_search = new Ext.Button({
		text : '查询',
		iconCls: 'icon-search',
		handler: function (){searchProject();}
	});

var beforeSellStore = new Ext.data.JsonStore(
			{
				url : '../project/searchProjects.form?status=11&timesnap=' + new Date()
						.getTime(),
				root : 'result',
				fields : [ 'PROJECT_ID', 'PROJECT_NAME', 'AREA_ID',
						'PROJECT_TYPE', 'EST_AMT', 'PROJECT_CREATE_DT',
						'EST_DT', 'JOIN_LEADER', 'CUSTOMER_NAME', 'STAFF_NUM',
						'CONTACT_PERSON', 'OFF_TEL', 'MOBILE', 'EMAIL',
						'PROJECT_TARGET', 'CUST_REQ', 'SERVICE_REQ',
						'IMP_FUNC', 'OWNER_PROVIDE', 'REMARK', 'COMPETITOR',
						'PROJECT_OWNER', 'INVOLVE_DT', 'ADVANTAGE',
						'DISADVANTAGE', 'CREATE_USER', 'CREATE_DT', 'MOD_USER',
						'MOD_DT' ],
				listeners : {
					scope : this,
					beforeload : function(thiz) {
						thiz.baseParams = {
							searchName : searchName.getValue(),
							searchArea : searchArea.getValue(),
							searchComplateDate : searchComplateDate.getValue() ? searchComplateDate.getValue().format('Y-m-d') : ''
						};
					}
				}
			});
var sellGrid = new Ext.grid.GridPanel({
		width : 930,
		height : 300,
		store : beforeSellStore,
		scope:this,
		listeners : {
			scope : this,
			rowmousedown : function(grid,index,e){
				var data = grid.store.getAt(index).data;
				setCompValueAndDisabledForBeforeSell(data);
				setProjectAssigner(data);
				project_id = data.PROJECT_ID;
				strackStore.reload({params:{projectId:data.PROJECT_ID}});
				fileStore.reload({params:{exeId:data.PROJECT_ID}});
			}
		},
	
		           
		           columns : [	{header:'主题名称',sortable: true,width: 100,dataIndex:'PROJECT_ID'},
					{header:'日期',sortable: true,width: 100,dataIndex:'PROJECT_ID'},
		           {header:'内容描述',width: 150, sortable: true,dataIndex:'PROJECT_NAME'},
		            {header:'消息类型',width: 150, sortable: true,dataIndex:'PROJECT_NAME'},
		             {header:'接受人',width: 150, sortable: true,dataIndex:'PROJECT_NAME'},
		              {header:'发布者',width: 100, sortable: true,dataIndex:'PROJECT_NAME'}
		         ],
		           
		           
       bbar:new Ext.PagingToolbar({
		 pageSize: 5,
         store: beforeSellStore,
         displayInfo: true,
         displayMsg: '显示第 {0} 条到 {1} 条记录，一共 {2} 条',
         emptyMsg: "没有记录..."
       })
	});
	
	
this.SendMessageHistoryPanel = new Ext.form.FormPanel({
	frame : true,
		width : 950,
		fileUpload: true, 
		labelWidth : 85,
	
		           
		           
		items : [{layout:'column',defaults:{layout:'form'},
			      items:[{columnWidth:0.3,items:[searchName]},
			        
			             {columnWidth:0.3,items:[searchComplateDate]},
			        
			              {columnWidth:0.3,items:[searchEndDate]},
			             {columnWidth:0.1,items:[btn_search]}
			             ]
				},sellGrid],
//					},sellGrid,followRec],
	   listeners: {
	    	render: {fn:function(){ 
					
					//strackStore.load();
			}}
		}
	});




};